home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / symcoff.arc / PLALLCPT.C < prev    next >
Text File  |  1989-05-02  |  3KB  |  59 lines

  1. static char *sccsid[]={"@(#)pldallcptr.c        2.1",
  2. "Copyright 1985 by Motorola Inc."};
  3. #include <stdio.h>
  4. #include <malloc.h>                  /*DBG for PCPORT*/
  5. #ifdef PCPORT
  6. #include <stdlib.h>
  7. #include "pcport.h"     /*PCPORT*/
  8. #endif
  9. #include "pfilehdr.h"
  10. #include "pldfcn.h"
  11.  
  12. #include "pldf_dcl.h"         /*PCPORT*/
  13. /****************** PLDALLOCPTR ****************************************gs##*/
  14. /*                                                                        ##*/
  15. /*                                                                        ##*/
  16. /* Written by:  Michael Greenberg - MIL                                   ##*/
  17. /*                                                                        ##*/
  18. /* ACTION:                                                                ##*/
  19. /*      Allocate an LDFILE structure.                                     ##*/
  20. /*                                                                        ##*/
  21. /* RETURNS:                                                               ##*/
  22. /*      pointer to location in memory availabe for an LDFILE ptr          ##*/
  23. /*                                                                        ##*/
  24. /* SYNOPSIS:                                                              ##*/
  25.       LDFILE *pldallocptr()                                             /*##*/
  26. /*    ---------------------                                               ##*/
  27. /*                                                                        ##*/
  28. /*************************************************************************##*/
  29. {
  30.         register LDFILE *ldptr;
  31.  
  32.         if((ldptr=(LDFILE *) malloc(LDFSZ)) == NULL)
  33.                 return(FAILURE);
  34.  
  35.         return(ldptr);
  36. }
  37.  
  38. /****************** PLDFREEPTR *****************************************gs##*/
  39. /*                                                                        ##*/
  40. /* ACTION:                                                                ##*/
  41. /*      Free the memory used by the LDFILE structure.                     ##*/
  42. /*                                                                        ##*/
  43. /* SYNOPSIS:                                                              ##*/
  44.       void pldfreeptr(ldptr)                                            /*##*/
  45. /*    ----------------------                                              ##*/
  46. register LDFILE *ldptr;                                                 /*##*/
  47. /*                                                                        ##*/
  48. /*************************************************************************##*/
  49. {
  50.         if(ldptr)
  51.         {
  52.                 fclose(IOPTR(ldptr));
  53.                 free(ldptr);
  54.                 ldptr = NULL;
  55.         }
  56. }
  57. /* Copyright 1985 by Motorola Inc. */
  58. 
  59.